<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends CommonController {
    public function index(){
        $list=D('Goodscategory')->where('pid=1')->select();
        $this->assign('list',$list);

        $list1=D('Goodscategory')->where('pid=6 and 15<id and id<21')->select();
        $this->assign('list1',$list1);

        $list2=D('Goodscategory')->where('pid=23')->select();
        $this->assign('list2',$list2);

        $list3=D('Goodscategory')->where('pid=24')->select();
        $this->assign('list3',$list3);

        $list4=D('Goodscategory')->where('pid=7 and 18<id and id<23')->select();
        $this->assign('list4',$list4);

        $list5=D('Goodscategory')->where('pid=47')->select();
        $this->assign('list5',$list5);

        $list6=D('Goodscategory')->where('pid=48')->select();
        $this->assign('list6',$list6);

        $list7=D('Goodscategory')->where('pid=8 and 66<id and id<70')->select();
        $this->assign('list7',$list7);

        $list8=D('Goodscategory')->where('pid=70')->select();
        $this->assign('list8',$list8);

        $list9=D('Goodscategory')->where('pid=71')->select();
        $this->assign('list9',$list9);

        $list10=D('Goodscategory')->where('pid=9 and 86<id and id<90')->select();
        $this->assign('list10',$list10);

        $list11=D('Goodscategory')->where('pid=91')->select();
        $this->assign('list11',$list11);

        $list12=D('Goodscategory')->where('pid=90')->select();
        $this->assign('list12',$list12);

        $list13=D('Goodscategory')->where('pid=10 and 120<id and id<124')->select();
        $this->assign('list13',$list13);

        $list14=D('Goodscategory')->where('pid=119')->select();
        $this->assign('list14',$list14);

        $list15=D('Goodscategory')->where('pid=120')->select();
        $this->assign('list15',$list15);

        $list16=D('Goodscategory')->where('pid=11 and 141<id and id<146')->select();
        $this->assign('list16',$list16);

        $list17=D('Goodscategory')->where('pid=146')->select();
        $this->assign('list17',$list17);

        $list18=D('Goodscategory')->where('pid=147')->select();
        $this->assign('list18',$list18);

        $list19=D('Goodscategory')->where('pid=148')->select();
        $this->assign('list19',$list19);

        $list20=D('Goodscategory')->where('pid=13 and 169<id and id<173')->select();
        $this->assign('list20',$list20);

        $list21=D('Goodscategory')->where('pid=173')->select();
        $this->assign('list21',$list21);

        $list22=D('Goodscategory')->where('pid=174')->select();
        $this->assign('list22',$list22);

        $list23=D('Goodscategory')->where('pid=14 and 186<id and id<190')->select();
        $this->assign('list23',$list23);

        $list24=D('Goodscategory')->where('pid=190')->select();
        $this->assign('list24',$list24);

        $list25=D('Goodscategory')->where('pid=191')->select();
        $this->assign('list25',$list25);

        $list26=D('Goodscategory')->where('pid=15 and 208<id and id<212')->select();
        $this->assign('list26',$list26);

        $list27=D('Goodscategory')->where('pid=212')->select();
        $this->assign('list27',$list27);

        $list28=D('Goodscategory')->where('pid=213')->select();
        $this->assign('list28',$list28);

        $list29=D('Goodscategory')->where('pid=214')->select();
        $this->assign('list29',$list29);

        $list30=D('Goodscategory')->where('pid=12 and 233<id and id<236')->select();
        $this->assign('list30',$list30);

        $list31=D('Goodscategory')->where('pid=236')->select();
        $this->assign('list31',$list31);

        $list32=D('Goodscategory')->where('pid=237')->select();
        $this->assign('list32',$list32);

        $goods = D('goods');
        $data = $goods->field('goods.gname,goodsimg.gid,goodsimg.icon,goodsimg.face,goods.id,goods.cid,goods.price,goods.stock,goods.cknum,goods.sales,goods.up,goods.hot,goods.des,goods.uptime')->join('goodsimg on goods.id=goodsimg.gid')->where(array('face'=>1,'up'=>1,'hot'=>1))->select();
        // $data=D('goods')->where(array('up'=>1,'hot'=>1))->select();
        $this->assign('data',$data);


        $lbimg=D('lbimg')->where(array('status'=>1))->select();
        $this->assign('data1',$lbimg);

        $friends=D('friends')->where(array('status'=>1))->select();
        $this->assign('data2',$friends);

        $advert=D('advert')->where(array('status'=>1,'advert'=>1))->select();
        $this->assign('data3',$advert);
        // var_dump($advert);exit;
        $advert1=D('advert')->where(array('status'=>1,'advert'=>2))->select();
        $this->assign('data4',$advert1);

        $advert2=D('advert')->where(array('status'=>1,'advert'=>3))->select();
        $this->assign('data5',$advert2);

        $this->display();
    }
}